package com.heima.comment.controller.v1;
/*
    
 需求描述：
 @Author: wang
 @Date: 2022/10/23 21:03
 
 */

import com.heima.comment.service.CommentRepayService;
import com.heima.model.comment.dtos.CommentRepayDto;
import com.heima.model.comment.dtos.CommentRepayLikeDto;
import com.heima.model.comment.dtos.CommentRepaySaveDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/comment_repay")
public class CommentRepayController {

    @Autowired
    private CommentRepayService repayService;

    @PostMapping("/save")
    public ResponseResult repaySave(@RequestBody CommentRepaySaveDto dto) throws Exception {

        return repayService.saveCommentRepay(dto);
    }

    @PostMapping("/load")
    public ResponseResult repayLoad(@RequestBody CommentRepayDto dto) throws Exception {

        return repayService.loadCommentRepay(dto);
    }

    @PostMapping("/like")
    public ResponseResult repayLike(@RequestBody CommentRepayLikeDto dto) throws Exception {

        return repayService.likeCommentRepay(dto);
    }
}
